#include "Invoke.h"
#include <QDebug>

#include "UI/ModRun/Output/FactoryOutput.h"

Invoke::Invoke(std::shared_ptr<InterFaceCommand> pCommand)
{
    m_pCommand = pCommand;
}

Invoke::~Invoke()
{

}

//执行;
void Invoke::Call()
{
    QString strOutput = "Invoke::Call:执行命令";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }

    if (m_pCommand)
    {
        m_pCommand->execute();
    }
}
